﻿<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Blog extends CI_Controller {
	public function __construct(){
		parent::__construct();
		$this->load->model('all_model');
	}
	public function index(){
		$items = $this->all_model->listAll();
		$data = array(
			'item'=>$items
		);
		$this->load->view('home',$data);
	}
	public function newData(){
		$data = array(
			'title'=>$this->input->post('title'),
			'blog'=>$this->input->post('blog'),
		);
		$status = $this->all_model->createNewData($data);
		if($status){
			redirect('home','refresh');
		}else{
			$this->load->view('no');
		}
	}
}

/* End of file blog.php */
/* Location: ./application/controllers/blog.php */